#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;

ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll x,p,k;
    cin>>p>>x>>k;
    vector<ll>num;
    for(ll i=1;i<=sqrt(k);i++){
        if(k%i==0){
            num.push_back(i);
            if(i==k/i)continue;
            num.push_back(k/i);
        }
    }
    ll sum=0;
    unordered_map<ll,ll>mp;
    for(ll i=0;;i++){
        if(i==num.size())break;
        if(num[i]>x||mp[num[i]])continue;
        sum++;
        mp[num[i]]=1;
        ll temp=num[i]*num[i];
        while(temp!=1){
            if(temp<=x&&temp>1){
                num.push_back(temp);
            }
            else break;
            ll ttt=temp;
            temp*=num[i];
            if(temp/num[i]!=ttt)break;
        }
    }
    for(ll i=1;i<=sqrt(p);i++){
        if(p%i==0){
            if(!mp.count(i)&&i<=x)sum++;
            if(i==p/i)continue;
            if(!mp.count(p/i)&&p/i<=x)sum++;
        }
    }
    cout<<sum;
    return 0;
}
